package xhq.com.test.extspring.bean;

import org.springframework.beans.BeansException;
import org.springframework.beans.factory.config.BeanFactoryPostProcessor;
import org.springframework.beans.factory.config.ConfigurableListableBeanFactory;
import org.springframework.stereotype.Component;

/**
 * 通过 注解 @Component 即可被 springboot 创建并执行
 * 与  BeanDefinitionRegistryPostProcessor 接口的 postProcessBeanFactory 方法差不多
 * 但是从日志打印顺序，好像是在 BeanDefinitionRegistryPostProcessor 接口的 postProcessBeanFactory 方法 之后
 * @author hq_xu
 * @since 2021/1/26 11:19
 */
@Component
public class MyBeanFactoryPostProcessor implements BeanFactoryPostProcessor {
    @Override
    public void postProcessBeanFactory(ConfigurableListableBeanFactory configurableListableBeanFactory) throws BeansException {
        System.out.println("from MyBeanFactoryPostProcessor");
    }
}
